<admintpl file="header" />
	<style>
		.center {
			text-align: center!important;
		}

		.select_area {
			width: 120px!important;
			height: 1.5rem;
			line-height: .2rem;
			display: inline-block;
			color: #707070;
			font-size: .14rem;
			padding: .05rem .08rem;
			border: 1px solid #707070;
			letter-spacing: .02rem;
			border-radius: .1rem;
			margin: 0 .07rem;
			margin-bottom: .1rem;
		}
	</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:U('Activity/Adminactivity/lists')}">活动列表</a></li>
			<li><a href="{:U('Activity/Adminactivity/edit', ['id' => $act_id])}">编辑活动</a></li>
			<li class="active"><a href="javascript:;">单位列表</a></li>
			<li><a href="{:U('Activity/Adminactivity/edit_host', array('act_id' => $act_id))}">添加单位</a></li>
		</ul>
		<form class="js-ajax-form" action="" method="post">
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="50">排序</th>
						<th width="50">ID</th>
						<th width="100">类别</th>
						<th width="150">单位名称</th>
						<th width="70">操作</th>
					</tr>
				</thead>
				<foreach name="lists" item="vo">
				<tr>
					<td><input data-id="{$vo.id}" class="input input-order" type="text" size="5" value="{$vo.sort}"></td>
                    <td>{$vo.id}</td>
					<td>{$vo['host_type'] == 1 ? '主办' : '协办'}</td>
					<td>{$vo.host_name}</td>
					<td>
						<a href="{:U('Activity/Adminactivity/edit_host',array('id' => $vo['id'], 'act_id' => $act_id))}">编辑</a> |
						<a href="{:U('Activity/Adminactivity/edit_host',array('id' => $vo['id'], 'act_id' => $act_id, 'del' => 1))}" class="js-ajax-delete">删除</a>
					</td>
				</tr>
				</foreach>
			</table>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>

	<script>
        $(document).ready(function () {
            $('body').delegate('.input-order', 'change', function () {
                var order 	= $(this).val();
                var id 		= $(this).attr('data-id');
                $.get("{:U('Activity/Adminactivity/change_acitvity_host_sort')}", {id : id, order : order}, function (data) {
                    if (data.status) {
                        window.location.reload();
                    }
                })
            })
        })
	</script>
</body>
</html>